<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ page trimDirectiveWhitespaces="true" %>
<fmt:setLocale value="zh_CN"/>
<%-- 权限判断 --%>
<shield:permssion type="leftMenu" value="1">
<c:forEach var="topMenu" items="${topMenus }">
	<c:if test="${topMenu.target == '_blank' }">
	<!-- 链接页面不处理 -->
	</c:if>
	<c:if test="${topMenu.target != '_blank' }">
<!-- class为shield-menus，容器，里面的菜单样式为shield-menu -->
<div class="leftModel shield-menus" permfor="${topMenu.pageId }" style="display: none;">
	<%-- <div class="head">${topMenu.name }</div> --%>
	<div class="content" style="margin-top: 15px;"> 
		
<c:forEach var="menu" items="${topMenu.childMenus }">
	<!-- 有下级，三级菜单 -->
	<c:if test="${not empty menu.childMenus }">
		<div class="subwrap">
			<div class="subwrap-x">
				<h4 class="sub_title">${menu.name }</h4>
				<ul class="menu">
		<c:forEach var="secondMenu" items="${menu.childMenus }">
					
			<c:choose>
				<%-- 打开新页面 --%>
				<c:when test="${secondMenu.target == '_blank' }">
					<li permId="${secondMenu.pageId }" id="${secondMenu.pageId }" title="${not empty secondMenu.title?secondMenu.title:secondMenu.name }" class="${secondMenu.pageClass }" 
						><a href="${secondMenu.href }" target="_blank" ><c:if 
				test="${not empty secondMenu.icon }"><img src="${ctxPath }/${secondMenu.icon}"></c:if>
					<span>${secondMenu.name }</span></a></li>
				</c:when>
				<%-- 弹出或iframe --%>
				<c:otherwise>
				<!-- data-rel-type为以iframe方式打开 -->
					<li permId="${secondMenu.pageId }" id="${secondMenu.pageId }" title="${not empty secondMenu.title?secondMenu.title:secondMenu.name }" class="${menu.target == 'dialog'?'shieldDialog ':'shield-menu '}  ${secondMenu.pageClass }" data-url="${secondMenu.href }" viewTitle="${menu.name }"
				<c:if test="${secondMenu.target == 'iframe' }">data-rel-type="iframe"</c:if> ><a href="#/${topMenu.pageId }/${secondMenu.pageId }" ><c:if 
				test="${not empty secondMenu.icon }"><img src="${ctxPath }/${secondMenu.icon}"></c:if>
					<span>${secondMenu.name }</span></a></li>
				</c:otherwise>
			</c:choose>
		</c:forEach>
				</ul>
			</div>
		</div>
	</c:if>
	<!-- 没有下级 -->
	<c:if test="${empty menu.childMenus }">
		<div class="subwrap">
			<div class="subwrap-x">
				<ul class="menu">
		<c:choose>
			<%-- 打开新页面 --%>
			<c:when test="${secondMenu.target == '_blank' }">
					<li permId="${menu.pageId }" id="${menu.pageId }" title="${not empty menu.title?menu.title:menu.name }" class="${menu.pageClass }" data-url="${menu.href }"  
					target="_blank"><a href="${menu.href }"><c:if test="${not empty menu.icon }"><img 
					src="${ctxPath }/${menu.icon}"></c:if><span>${menu.name }</span></a></li>
			</c:when>
			<%-- 弹出或iframe --%>
			<c:otherwise>
					<!-- data-rel-type为以iframe方式打开 -->
					<li permId="${menu.pageId }" id="${menu.pageId }" title="${not empty menu.title?menu.title:menu.name }" class="${menu.target == 'dialog'?'shieldDialog ':'shield-menu '}  ${menu.pageClass }" data-url="${menu.href }" viewTitle="${menu.name }" <c:if 
				test="${menu.target == 'iframe' }">data-rel-type="iframe"</c:if> ><a href="#/${topMenu.pageId }/${menu.pageId }"><c:if 
				test="${not empty menu.icon }"><img src="${ctxPath }/${menu.icon}"></c:if><span>${menu.name }</span></a></li>
			</c:otherwise>
		</c:choose>
				</ul>
			</div>
		</div>
	</c:if>
</c:forEach>

	</div>
</div>
	</c:if>
</c:forEach>
</shield:permssion>
